package com.boot.service.impl;

import com.boot.controller.SupplierManagementController;
import com.boot.dao.SupplierManagementDao;
import com.boot.entity.*;
import com.boot.service.ISupplierManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ISupplierManagementServiceImpl implements ISupplierManagementService {

    @Autowired
    public SupplierManagementDao dao;

    @Override
    public List<Map<String, Object>> queryAllSupplier(int companyId ,String supplierName) {
        return dao.queryAllSupplier(companyId,supplierName);
    }

    @Override
    public int countSupplierList(int companyId,String supplierName) {
        return queryAllSupplier(companyId,supplierName).size();
    }

    @Override
    public Map<String, Object> querySupplierDetails(int supplierId) {

        return dao.querySupplierDetails(supplierId);
    }

    @Override
    public List<Map<String, Object>> queryCheck(int supplier, int companyId) {
        List<Map<String, Object>> check1 = dao.queryCompanyCheck(supplier, companyId);
        List<Map<String, Object>> check2 = dao.querySupplierCheck(supplier, companyId);
        check1.addAll(check2);
        return check1;
    }

    @Override
    public List<Map<String, Object>> queryCompanyApply(int companyId,String auditStatus,String supplierName) {
        return dao.queryCompanyApply(companyId,auditStatus,supplierName);
    }

    @Override
    public int countCompanyApply(int companyId, String auditStatus, String supplierName) {
        return queryCompanyApply(companyId,auditStatus,supplierName).size();
    }

    @Override
    public Map<String, Object> queryCompanyApplyById(int csId) {
        return dao.queryCompanyApplyById(csId);
    }

    @Override
    public List<Map<String, Object>> queryPowerApply(int companyId,String auditStatus,String supplierName) {
        return dao.queryPowerApply(companyId,auditStatus,supplierName);
    }

    @Override
    public Map<String, Object> queryPowerApplyById(int bePSupplierId) {
        return dao.queryPowerApplyById(bePSupplierId);
    }

    @Override
    public int countPowerApply(int companyId,String auditStatus,String supplierName) {
        return dao.queryPowerApply(companyId,auditStatus,supplierName).size();
    }

    @Override
    public List<Map<String, Object>> queryBlackApply(int companyId,String auditStatus,String supplierName) {
        return dao.queryBlackApply(companyId,auditStatus,supplierName);
    }

    @Override
    public int countBlackApply(int companyId,String auditStatus,String supplierName) {
        return dao.queryBlackApply(companyId,auditStatus,supplierName).size();
    }

    @Override
    public Map<String, Object> queryBlackApplyById(int blacklistId) {
        return dao.queryBlackApplyById(blacklistId);
    }

    @Override
    public Map<String, Object> queryBlackApplyCheck(int blacklistId) {
        return dao.queryBlackApplyCheck(blacklistId);
    }

    @Override
    public List<Map<String, Object>> queryYearScore(int years, int companyId ,String supplierName) {
        return dao.queryYearScore(years, companyId,supplierName);
    }

    @Override
    public int countYearScore(int years, int companyId,String supplierName) {
        return queryYearScore(years, companyId,supplierName).size();
    }

    @Override
    public List<Map<String, Object>> queryMonthScore(int supplierId, int years) {
        return dao.queryMonthScore(supplierId, years);
    }

    @Override
    public boolean updataBeCSupplier(BeCSupplier beCSupplier) {
        return dao.updataBeCSupplier(beCSupplier);
    }

    @Override
    public boolean saveCompanyApplyCheck(CSCheck csCheck) {

        return dao.saveCompanyApplyCheck(csCheck);
    }

    @Override
    public boolean saveCompanySupplier(CompanySupplier companySupplier) {
        return dao.saveCompanySupplier(companySupplier);
    }

    @Override
    public List<Integer> queryAllPowerId(int companyId) {

        return dao.queryAllPowerId(companyId);
    }

    @Override
    public boolean savePowerSupplier(PowerPlantSupplier pSupplier) {

        return dao.savePowerSupplier(pSupplier);
    }

    @Override
    public boolean updataBePSupplier(BePSupplier bePSupplier) {
        return dao.updataBePSupplier(bePSupplier);
    }

    @Override
    public Boolean savePSCheck(PSCheck psCheck) {
        return dao.savePSCheck(psCheck);
    }

    @Override
    public CompanySupplier queryCompanySupplier(int companyId, int supplierId) {
        return dao.queryCompanySupplier(companyId,supplierId);
    }

    @Override
    public Boolean updataCompanySupplier(CompanySupplier companySupplier) {
        return dao.updataCompanySupplier(companySupplier);
    }

    @Override
    public List<Integer> queryPowerSupplierId(int companyId, int supplierId) {
        return dao.queryPowerSupplierId(companyId,supplierId);
    }

    @Override
    public Boolean updataBlackList(BlackList blackList) {
        return dao.updataBlackList(blackList);
    }

    @Override
    public Boolean saveBlackListCheck(BlackListCheck blackListCheck) {
        return dao.saveBlackListCheck(blackListCheck);
    }

    @Override
    public Boolean updataPowerSupplierBlack(int companyId, int supplierId) {
        return dao.updataPowerSupplierBlack(companyId,supplierId);
    }

    @Override
    public Boolean updataPowerSupplierType(int companyId, int supplierId, String supplierType) {
        return dao.updataPowerSupplierType(companyId,supplierId,supplierType);
    }
}
